package cn.tom.tools;

import java.util.Random;

/**
 * @author 酒辞
 */
public class CodeUtil {
    private final static int[] arr = {1,2,3,4,5,6,7,8,9,0};
    private final static int number = 6;
    public static String getCode(){
        Random random = new Random();
        StringBuffer bf = new StringBuffer();
        for (int i = 0; i < number ; i++) {
            int j = random.nextInt(arr.length);
            bf.append(arr[j]);
        }
        System.out.println(bf.toString());
        return bf.toString();
    }
}
